ssjm.SECRET_KEY = CryptoJS.enc.Utf8.parse("shoushajiemian91"); // 十六位十六进制数作为密钥
ssjm.SECRET_IV = CryptoJS.enc.Utf8.parse("shoushajiemian91"); // 十六位十六进制数作为密钥偏移量
ssjm.encrypt = (data) => {
  if (typeof data === "object") {
    try {
      data = JSON.stringify(data);
    } catch (error) {
      console.log("encrypt error:", error);
    }
  }
  const dataHex = CryptoJS.enc.Utf8.parse(data);
  const encrypted = CryptoJS.AES.encrypt(dataHex, ssjm.SECRET_KEY, {
    iv: ssjm.SECRET_IV,
    mode: CryptoJS.mode.CBC,
    padding: CryptoJS.pad.Pkcs7,
  });
  return encrypted.ciphertext.toString();
};
ssjm.decrypt = function (data) {
  const encryptedHexStr = CryptoJS.enc.Hex.parse(data);
  const str = CryptoJS.enc.Base64.stringify(encryptedHexStr);
  const decrypt = CryptoJS.AES.decrypt(str, ssjm.SECRET_KEY, {
    iv: ssjm.SECRET_IV,
    mode: CryptoJS.mode.CBC,
    padding: CryptoJS.pad.Pkcs7,
  });
  const decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
  const work = decryptedStr.toString();
  if (typeof JSON.parse(work) === "object") return JSON.parse(work);
  return work;
};

window.ssjmConfig = ssjm.encrypt({
  popularCharacter: {
    recommendation: ["zhoutai", "zhangchunhua", "liuchen", "caorui", "re_lusu", "re_zhaoyun", "zuoci"],
    newOnline: ["sb_zhugejin", "dc_jiachong", "sb_jiaxu", "mb_zhangbu", "mb_sp_zhenji", "sb_guojia", "sb_zhangliao", "mb_sp_ganfuren", "mb_wangjing"],
    award: ["zhongyao", "zhugeguo", "chengyu", "caochun", "wutugu"],
    wuxing: ["huangyueying", "xin_xushu", "re_sunquan", "sb_huangzhong"]
  },
});
let a = "caZ0s2coVqkuEkdj";
let b = "Fb01tmaz6llbvWsZ";